package com.park.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.park.dao.PermissionsMapper;
import com.park.model.Permissions;
import com.park.service.PermissionsService;

@Service
public class PermissionsServiceImpl implements PermissionsService {

	@Autowired
	private PermissionsMapper permissionsMapper;
	@Override
	public int insert(Permissions permissions) {
		// TODO Auto-generated method stub
		return permissionsMapper.insert(permissions);
	}

	@Override
	public int update(Permissions permissions) {
		// TODO Auto-generated method stub
		return permissionsMapper.updateByPrimaryKeySelective(permissions);
	}

	@Override
	public int delete(long id) {
		// TODO Auto-generated method stub
		return permissionsMapper.deleteByPrimaryKey(id);
	}

	@Override
	public List<Permissions> selectList(int startPage, int pageSize) {
		// TODO Auto-generated method stub
		return permissionsMapper.selectList(startPage,pageSize);
	}

	@Override
	public List<String> getByUserId(Long id) {
		// TODO Auto-generated method stub
		return permissionsMapper.getByUserId(id);
	}

	@Override
	public List<Permissions> getByName(String userName) {
		// TODO Auto-generated method stub
		return permissionsMapper.getByName(userName);
	}

	@Override
	public List<Permissions> getByRoleName(String userName) {
		// TODO Auto-generated method stub
		return permissionsMapper.getByRoleName(userName);
	}

}
